package com.springboot.search.dao;

import com.springboot.search.entity.Goods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.math.BigInteger;
import java.util.List;

public interface SearchDao extends JpaRepository<Goods, BigInteger> {

    @Query("select g from Goods g where g.goodsName like concat('%',:search,'%') " +
            "or g.goodsDescribe like concat('%',:search,'%')")
    List<Goods> queryGoods(@Param("search")String search);
}
